---
layout: example.html
title: Map Export
shortdesc: Export a map as a PNG image.
docs: >
  Example of exporting a map as a PNG image, using a HTMLCanvasElement as temporary map target.
tags: "export, png, openstreetmap"
resources:
  - https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css
  - https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/fontawesome.min.css
  - https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/solid.css
---
<div id="map" class="map"></div>
<a id="export-png" class="btn btn-outline-dark" role="button"><i class="fa fa-download"></i> Download PNG</a>
<a id="image-download" download="map.png"></a>
